package com.lab.component.list.simple;

import android.view.View;

import com.lab.adapter.IAdapterData;
import com.lab.component.list.viewholder.CTRecycleViewHolder;
import com.lab.logtrack.AppLog;

/**
 * Created by ak on 4/5/16.
 */
public class CTSimpleViewHolder extends CTRecycleViewHolder {

    private View view;

    public CTSimpleViewHolder(View itemView) {
        super(itemView);
        this.view = itemView;
    }

    @Override
    public void render(IAdapterData iAdapterData, int position) {

    }

    public <T extends View> T getView(int id) {
        return (T) view.findViewById(id);
    }

    public <T> T getView(int id, Class<T> viewType) {
        try {
            return (T) view.findViewById(id);
        } catch (Exception e) {
            AppLog.w(e.getMessage());
        }
        return null;
    }


    public View getView() {
        return view;
    }
}
